package edu.gatech.spacetraderteam3.model;

/**
 * Enumerated type for Tech levels.
 * 
 * @author Aaron
 * @version 2002
 */
public enum TechLevel {
    PRE_AGRICULTURAL(0),
    AGRICULTURAL(1),
    MEDIEVAL(2),
    RENAIASANCE(3),
    EARLY_INDUSTRIAL(4),
    INDUSTRIAL(5),
    POST_INDUSTRIAL(6),
    HIGH_TECH(7);

    /**
     * The level of technological advancement on a planet
     */
    private final int level;

    /**
     * Constructor for tech level.
     * 
     * @param level
     *            Numerical representation of the tech level.
     */
    private TechLevel(int level) {
        this.level = level;
    }

    /**
     * Getter for the level of the TechLevel in question.
     * 
     * @return The numerical representation of the tech level.
     */
    public int level() {
        return this.level;
    }

    /**
     * Helper method that spits out a random Tech Level.
     * 
     * @return A random tech level.
     */
    public static TechLevel random() {
        return values()[(int) (Math.random() * values().length)];
    }
}
